package net.lgpage.db;

import com.matriq.cloudmanager.entity.db.DownloadCourseInfo;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

public class DBHelper extends SQLiteOpenHelper {

	private final static String dbName="CloudManager";
	private final static String TAG = "DBHelper";
	public final static int currentVersion=1;
	public DBHelper(Context context,
			int version) {
		super(context, dbName, null, version);
	}
	public void onCreate(SQLiteDatabase db) {
		db.execSQL(DBUtil.createTableSql(DownloadCourseInfo.class));
	}
	
	public void onUpgrade(final SQLiteDatabase db, int oldVersion, int newVersion) {
		Log.e(TAG, "数据库更新"+oldVersion+"/"+newVersion);
	}
	
	public static SQLiteDatabase getDB(Context context){
		DBHelper dbhelper = new DBHelper(context,currentVersion);
		SQLiteDatabase db = dbhelper.getWritableDatabase();
		return db;
	}
	
	
}
